﻿namespace CollisionDetection.Models
{
    public class UcAttendance
    {
        public int UcId { get; set; }
        public string TipoAula { get; set; }
        public int StudentsSigned { get; set; }
        public int StudentsWithCollisions { get; set; }

        public bool Equals(UcAttendance other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other.UcId == UcId && Equals(other.TipoAula, TipoAula);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (UcAttendance)) return false;
            return Equals((UcAttendance) obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (UcId*397) ^ (TipoAula != null ? TipoAula.GetHashCode() : 0);
            }
        }
    }
}
